package com.slife.snap.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration

public class ImgFileConfig implements WebMvcConfigurer {

//    http://127.0.0.1:8082/img/文件名.jpg

    //    http://127.0.0.1:8082/img/01a5b655-94d8-4505-b894-6ad47f87cf98_66.jpg
//    http://127.0.0.1:8888/img/2023-07-24/20230724115817923_65.jpg
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/img/**") //虚拟url路径
                .addResourceLocations("file:E:/docs/img/0720/"); //真实本地路径
    }
}
